// 2013-7-29下午04:18:13  net.betou.trade.entity.main.base.BaseNotice.java

package net.betou.trade.entity.main.base;

import java.io.Serializable;
import java.util.Date;

import net.betou.trade.entity.main.AgentAndAdmins;
import net.betou.trade.entity.main.Notice;
import net.betou.trade.entity.main.NoticeType;

/**
 * 公告
 * @author 叶装装
 */
public abstract class BaseNotice implements Serializable{

	
	private static final long serialVersionUID = 8172119735885604244L;
	private Integer id;
	private String title;
	private String content;
	private Date addDate;
	private String orientedGroup; // 面向用户组, 多个之间使用"," 分隔
	private String smsSendGroup; // 短信发送的用户组, 多个之间使用 ","号分隔
	private String smsContent; // 短信内容
	
	// many to one
	private NoticeType noticeType;
	private AgentAndAdmins admin;
	
	public BaseNotice( ){}

	public Integer getId( ) {
		return id;
	}

	public void setId( Integer id ) {
		this.id = id;
		this.hashCode = Integer.MIN_VALUE;
	}

	public String getTitle( ) {
		return title;
	}

	public void setTitle( String title ) {
		this.title = title;
	}

	public String getContent( ) {
		return content;
	}

	public void setContent( String content ) {
		this.content = content;
	}

	public Date getAddDate( ) {
		return addDate;
	}

	public void setAddDate( Date addDate ) {
		this.addDate = addDate;
	}

	public NoticeType getNoticeType( ) {
		return noticeType;
	}

	public void setNoticeType( NoticeType noticeType ) {
		this.noticeType = noticeType;
	}

	public AgentAndAdmins getAdmin( ) {
		return admin;
	}

	public void setAdmin( AgentAndAdmins admin ) {
		this.admin = admin;
	}
	
	public String getOrientedGroup( ) {
		return orientedGroup;
	}

	public void setOrientedGroup( String orientedGroup ) {
		this.orientedGroup = orientedGroup;
	}

	public String getSmsSendGroup( ) {
		return smsSendGroup;
	}

	public void setSmsSendGroup( String smsSendGroup ) {
		this.smsSendGroup = smsSendGroup;
	}

	public String getSmsContent( ) {
		return smsContent;
	}

	public void setSmsContent( String smsContent ) {
		this.smsContent = smsContent;
	}

	private int hashCode = Integer.MIN_VALUE;
	
	public boolean equals( Object obj ) {
		if( null == obj )
			return false;
		if( !( obj instanceof Notice ) )
			return false;
		else{
			Notice notice = ( Notice ) obj;
			if( null == this.getId( ) || null == notice.getId( ) )
				return false;
			else
				return( this.getId( ).equals( notice.getId( ) ) );
		}
	}

	public int hashCode( ) {
		if( Integer.MIN_VALUE == this.hashCode ){
			if( null == this.getId( ) )
				return super.hashCode( );
			else{
				String hashStr = this.getClass( ).getName( ) + ":" + this.getId( ).hashCode( );
				this.hashCode = hashStr.hashCode( );
			}
		}
		return this.hashCode;
	}
	
}
